// import request from '../utils/request';

// export function queryDocumentTree() {
//   return request('/cwm/package/topfile');
// }

import http from '@vadp/http';

// 获取Tree数据
export async function apiQueryDocumentTree() {
    return http.get('/cwm/package/topfile');
}

// 保存 Tree 节点
export async function apiSaveTreeNode(item) {
    return http.post('/cwm/package/file/save', {data: { ...item }});
}

// 删除 Tree 节点
export async function apiDeleteTreeNode(id) {
    return http.get('/cwm/package/file/delete/'+ id );
}



// 读取文档的元模型定义
export async function apiQueryTableClassifier() {
    return http.get('/cwm/document/classifier/getclassifier');
}

// 文档分页列表
export async function apiQueryDocumentList(item) {
  return http.post('/cwm/document/page', {data: { ...item }});
}

// 上传文档
export async function apiUploadDocument(item) {
  return http.post( '/cwm/document/upload', {data: { ...item }});
}

// 保存文档
export async function apiSaveDocument(item) {
  return http.post('/cwm/document/save', {data: { ...item }});
}

// 获取文档信息
export async function apiQueryDocumentInfo(id) {
  return http.get('/cwm/document/getbean/'+id);
}

// 获取所有组织列表
export async function apiQueryAllOrg() {
  return http.get('/cwm/org/all');
}

// 获取所有用户列表
export async function apiQueryAllUser() {
  return http.get('/cwm/user/all');
}